﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
namespace QuadRemote.Tabs
{
    class LogPanel : GroupBox
    {
        Label loggingStatus;
        Label sdStatus;

        Button enableLogging;
        Button disableLogging;
        Button readSD;
        Button clearSD;
        Button downloadFile;

        ListBox files;

        public LogPanel() : base()
        {
            Text = "Logging";
            Size = new Size(400, 300);
            int y = 25;

            loggingStatus = new Label();
            loggingStatus.Location = new Point(5, y);
            loggingStatus.Size = new Size(Width - 10, 25);
            loggingStatus.Text = "Logging status:";
            Controls.Add(loggingStatus);

            y += 30;
            sdStatus = new Label();
            sdStatus.Location = new Point(5, y);
            sdStatus.Size = new Size(Width - 10, 25);
            sdStatus.Text = "SD status:";
            Controls.Add(sdStatus);

            y += 30;
            enableLogging = new Button();
            enableLogging.Location = new Point(5, y);
            enableLogging.Size = new Size(Width / 2 - 10, 35);
            enableLogging.Text = "Start manual logging";
            Controls.Add(enableLogging);

            disableLogging = new Button();
            disableLogging.Location = new Point(Width / 2 + 5, y);
            disableLogging.Size = new Size(Width / 2 - 10, 35);
            disableLogging.Text = "Disable auto logging";
            Controls.Add(disableLogging);

            y += 40;
            files = new ListBox();
            files.Location = new Point(5, y);
            files.Size = new Size(Width / 2 - 10, Height - files.Top - 10);
            Controls.Add(files);

            readSD = new Button();
            readSD.Location = new Point(Width / 2 + 5, y);
            readSD.Size = new Size(Width / 2 - 10, 35);
            readSD.Text = "Read SD Card";
            Controls.Add(readSD);

            y += 40;

            downloadFile = new Button();
            downloadFile.Location = new Point(Width / 2 + 5, y);
            downloadFile.Size = new Size(Width / 2 - 10, 35);
            downloadFile.Text = "Download";
            Controls.Add(downloadFile);

            y += 40;
            clearSD = new Button();
            clearSD.Location = new Point(Width / 2 + 5, y);
            clearSD.Size = new Size(Width / 2 - 10, 35);
            clearSD.Text = "Format card";
            Controls.Add(clearSD);
        }
    }
}
